/*
 * This file is part of the Android Dimensions Editor Project: http://code.google.com/p/android-dimension-editor/
 *  
 * Copyright (c) 2013 Rick Falck
 *  
 * This code is licensed under the terms of the Apache License Version 2.0.
 * You may use this code according to the license.
 *
 * The terms of the license can be found in the root directory of this project's repository as well as at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *  
 * Unless required by applicable law or agreed to in writing, software
 * distributed under these Licenses is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See each License for the specific language governing permissions and
 * limitations under that License.
 */
package model;
/**
 * <b>public class ReturnInfo</b>
 * <p>
 * This class is used to return the results of a function call that requires a result code
 * and additional data.
 * 
 * @author Rick Falck
 */
public class ReturnInfo {
	private boolean mSuccess = true;;
	private String mErrorMessage = null;
	private String mOtherInfo = null;
	private ERROR_TYPE mErrorType;

	public ReturnInfo() {	}

	public ReturnInfo(ERROR_TYPE errorType, String errorMsg) {
		mSuccess = false;
		mErrorType = errorType;
		mErrorMessage = errorMsg;
	}

	public ReturnInfo(boolean response) {
		mSuccess = response;
	}

	public boolean isSuccess() {
		return mSuccess;
	}

	public void setSuccess(boolean success) {
		mSuccess = success;
	}

	public String getErrorMessage() {
		return mErrorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		mErrorMessage = errorMessage;
	}

	public ERROR_TYPE getErrorType() {
		return mErrorType;
	}

	public void setErrorType(ERROR_TYPE errorType) {
		mErrorType = errorType;
	}

	public String getOtherInfo() {
		return mOtherInfo;
	}

	public void setOtherInfo(String otherInfo) {
		mOtherInfo = otherInfo;
	}

	public enum ERROR_TYPE {
		FILE_IO, 
		XML_READ, 
		XML_WRITE, 
		FIELD_FORMAT,
		OTHER
	}

}
